//
//  HNoticeTableCell.m
//  SSIL
//
//  Created by 余胜民 on 16/5/13.
//  Copyright © 2016年 sanmy. All rights reserved.
//

#import "HNoticeTableCell.h"

@interface HNoticeTableCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *authorLabel;
@property (nonatomic, strong) UILabel *publishDateLabel;
@property (nonatomic, strong) UILabel *endDateLabel;

@end

@implementation HNoticeTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self initUI];
        
    }
    return self;
}
- (void)initUI {
    
    [self addSubview:self.titleLabel];
    [self addSubview:self.authorLabel];
    [self addSubview:self.publishDateLabel];
    [self addSubview:self.endDateLabel];
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        UILabel *titleLabel = [[UILabel alloc] init];
        UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10);
        
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.edges.equalTo(self).with.insets(padding);
            
        }];
        titleLabel.font = [UIFont systemFontOfSize:13.0f];
        titleLabel.textColor = [UIColor lightGrayColor];
        titleLabel.textAlignment = NSTextAlignmentLeft;
        
        _titleLabel = titleLabel;
        
    }
    
    return _titleLabel;
}

- (void)configureDataWithModel:(HNoticeModel *)model {
    self.titleLabel.text = model.resultdata;
}

@end
